package cn.jtcoding.springframework.core.support;

import cn.jtcoding.springframework.core.support.BeanDefinition;
import cn.jtcoding.springframework.enums.ScopeEnum;

public abstract class AbstractBeanDefinition implements BeanDefinition {
    public static final String SCOPE_DEFAULT = "";
    public static final int AUTOWIRE_NO = 0;
    public static final int AUTOWIRE_BY_NAME = 1;
    public static final int AUTOWIRE_BY_TYPE = 2;
    public static final int AUTOWIRE_CONSTRUCTOR = 3;

    // bean class
    private volatile Class<?> beanClass;
    // 单例 或 原形态
    private ScopeEnum scope;
    // 懒加载
    private Boolean lazyInit;
    // 自动注入模式
    private int autowireMode;
    // 是否自动注入
    private boolean autowireCandidate;
    // 初始化方法
    private String initMethodName;
    // 销毁方法
    private String destroyMethodName;
    // 描述信息
    private String description;

    protected AbstractBeanDefinition() {
    }

    public Class<?> getBeanClass() {
        return beanClass;
    }

    public void setBeanClass(Class<?> beanClass) {
        this.beanClass = beanClass;
    }

    public ScopeEnum getScope() {
        return scope;
    }

    public void setScope(ScopeEnum scope) {
        this.scope = scope;
    }

    public Boolean getLazyInit() {
        return lazyInit;
    }

    public void setLazyInit(Boolean lazyInit) {
        this.lazyInit = lazyInit;
    }

    public int getAutowireMode() {
        return autowireMode;
    }

    public void setAutowireMode(int autowireMode) {
        this.autowireMode = autowireMode;
    }

    public boolean isAutowireCandidate() {
        return autowireCandidate;
    }

    public void setAutowireCandidate(boolean autowireCandidate) {
        this.autowireCandidate = autowireCandidate;
    }

    public String getInitMethodName() {
        return initMethodName;
    }

    public void setInitMethodName(String initMethodName) {
        this.initMethodName = initMethodName;
    }

    public String getDestroyMethodName() {
        return destroyMethodName;
    }

    public void setDestroyMethodName(String destroyMethodName) {
        this.destroyMethodName = destroyMethodName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
